﻿<div class="modal" tabindex="-1" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog"  style=" width: 1000px;">
        <div class="modal-content">
            <form name="userForm" novalidate>
                <div class="modal-header">
                    <button type="button" class="close" ng-click="close(false)" data-dismiss="modal"
                            aria-hidden="true">&times;</button>
                    <h4 class="modal-title">&nbsp;{{modalTitle}}&nbsp;</h4>
                </div>

                <div class="modal-body">
                    <div class="panel-body">
                        <div class="row">
                            <div class="input-group pdb15">
                                <div class="row" style="margin-top: 15px">
                                    <label class="col-md-2 control-label input-label">计划名称:
                                        <span ng-show="userForm.name.$error.required || userForm.name.$invalid" style="color:red">*</span>
                                    </label>

                                    <div class="col-md-3 input-width-sm">
                                        <input type="text"  name="name" class="form-control" ng-model="vm.currentPriceAdjustment.name" required>
                                    </div>
                                    <label class="col-md-2 control-label input-label" style="left: 17px;">执行时间:
                                        <span ng-show="userForm.effectTime.$error.required || userForm.effectTime.$invalid" style="color:red">*</span></label>
                                    <div class="col-md-3 input-width-sm"  style="left: 17px;">
                                        <input type="text"  name="effectTime" id="datetimepickerStartExcute"  class="form-control" ng-model="vm.currentPriceAdjustment.effectTime" required>
                                        <!--<input type="text"  ng-hide="inputHidden_effectTime" class="form-control" ng-model="vm.currentPriceAdjustment.effectTime" required>-->
                                    </div>
                                </div>

                                <div class="row" style="margin-top: 15px">
                                    <label class="col-md-2 control-label input-label">商品类型:
                                        <span ng-show="isCreate" style="color:red">*</span></label>
                                    <div class="col-md-3 input-width-sm">
                                        <select name="goodsType" ng-model="temp.selectedGoodsType" ng-options="goodsType.name for goodsType in temp.goodsTypesList" class="form-control" ng-selected="" ng-change="goodsTypeChange()"></select>
                                    </div>
                                    <label class="col-md-2 control-label input-label" style="left: 17px;">商品规格:
                                        <span ng-show="isCreate" style="color:red">*</span></label>
                                    <div class="col-md-3 input-width-sm" style="left: 17px;">
                                    <select name="goods" ng-model="temp.selectedGoods" ng-options="goods.name for goods in temp.goodsList" class="form-control" ng-selected="" ng-change="goodsChange()"></select>
                                    </div>

                                </div>

                                <div class="row" style="margin-top: 15px">
                                    <label class="col-md-2 control-label input-label">所属区域：</label>
                                    <div class="col-md-3" input-width-sm>
                                        <select name="province" ng-model="vm.goods.area.province" ng-options="province for province in config.provinces" class="form-control" ng-selected="" ng-change="provincesChange()"></select>
                                    </div>
                                    <div class="col-md-3" input-width-sm>
                                        <select name="city" ng-model="vm.goods.area.city" ng-options="city for city in config.citys" class="form-control" ng-selected="" ng-change="citysChange()"></select>
                                    </div>
                                    <div class="col-md-3" input-width-sm>
                                        <select name="county" ng-model="county" ng-options="county for county in config.countys" class="form-control" ng-selected="" ng-change="countysChange()"></select>
                                    </div>
                                </div>

                                <div class="row" style="margin-top: 15px">
                                    <label class="col-md-2 control-label input-label">现价(元):</label>
                                    <div class="col-md-3 input-width-sm">
                                        <input type="number"  class="form-control" ng-model="temp.selectedGoods.price" disabled>
                                    </div>
                                    <label class="col-md-2 control-label input-label" style="left: 17px;">调价(元):
                                        <!--<span ng-show="userForm.number.$error.required || userForm.number.$invalid" style="color:red">*</span></label>-->
                                        <span ng-show="isCreate" style="color:red">*</span></label>

                                    <div class="col-md-3 input-width-sm" style="left: 17px;">
                                        <input type="number"  name="number" class="form-control" ng-model="temp.adjustGoodsPrice" min="0" onkeyup="this.value=this.value.replace(/\-/g,'');" required>
                                    </div>

                                    <button type="button" style="left: 10px;" class="btn btn-sm btn-success pull-right" ng-click="addToCart()"><i class="fa fa-plus"></i> 添加调价列表</button>

                                </div>

                                <div class="row" style="margin-top: 15px">
                                    <label style="margin-left:22px;" class="control-label input-label" >添加调价列表:
                                        <span ng-show="isCreate" style="color:red">*</span></label>
                                </div>
                            </div>


                        </div>

                        <div class="row" >
                            <table class="table table-bordered table-hover .table-condensed">

                                <thead>
                                <tr>
                                    <td style="background: lightblue;text-align: center" width="8%">序号</td>
                                    <td style="background: lightblue;text-align: center" width="8%">商品号</td>
                                    <td style="background: lightblue;text-align: center" width="12%">商品名称</td>
                                    <td style="background: lightblue;text-align: center" width="10%">商品类型</td>
                                    <td style="background: lightblue;text-align: center" width="10%">商品规格</td>
                                    <td style="background: lightblue;text-align: center" width="9%">现价(元)</td>
                                    <td style="background: lightblue;text-align: center" width="10%">调价(元)</td>
                                    <td style="background: lightblue;text-align: center" width="5%">操作</td>
                                </tr>
                                </thead>
                                <tbody>
                                <tr ng-repeat="adjustPriceDetail in vm.currentPriceAdjustment.adjustPriceDetailList">
                                    <td class="message">{{$index+1}}</td>
                                    <td class="message">{{adjustPriceDetail.goods.code}}</td>
                                    <td class="message">{{adjustPriceDetail.goods.name}}</td>
                                    <td class="message">{{adjustPriceDetail.goods.goodsType.name}}</td>
                                    <td class="message">{{adjustPriceDetail.goods.specifications}}</td>
                                    <td class="message">{{adjustPriceDetail.goods.price}}</td>
                                    <td class="message">{{adjustPriceDetail.price}}</td>
                                    <td class="operate">
                                        <button title="删除" ng-click="deleteGoodsFromCart(adjustPriceDetail)" type="button" class="btn btn-primary btn-outline btn-xs">
                                            <i class="fa fa-trash-o"></i>
                                        </button>
                                    </td>
                                </tr>

                                </tbody>
                            </table>
                            <div class="row" style="margin-top: 15px">
                                <label style="margin-left:22px;color:red" class="control-label input-label" ng-show="isCreate">带*为必填项</label>
                            </div>
                        </div>
                    </div>
                </div>


                <div class="modal-footer">
                    <button type="submit"  ng-hide="vm.currentPriceAdjustment.status.index == 1 ? true : false"
                            ng-disabled="userForm.name.$error.required || userForm.effectTime.$error.required"
                            ng-click="submit(vm.currentPriceAdjustment)" class="btn btn-primary" data-dismiss="modal">保存</button>
                    <!--ng-disabled="userForm.name.$error.required || userForm.effectTime.$error.required|| userForm.number.$error.required"-->
                    <button type="button" ng-click="close(false)" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </form>
        </div>
    </div>
</div>